import React from 'react'
import { useNavigate } from 'react-router-dom'
import { ArrowLeft, ShareO } from '@react-vant/icons';
export default function Hoc(props) {
    const nav = useNavigate()
    const title = props.title
    const a = () => {
        if (title == '预约挂号') {
            return <div className='home_top'>
                <div className='home_left'>
                    <ArrowLeft onClick={() => nav('/list')} />
                </div>
                <div className='home_center'>预约挂号</div>
                <div className='home_right'>
                    <ShareO />
                </div>
            </div>
        }else if(title=='医院详情页'){
            return <div className='home_top'>
            <div className='home_left'>
                <ArrowLeft onClick={() => nav('/list')} />
            </div>
            <div className='home_center'>医院详情页</div>
            <div className='home_right'>
                <ShareO />
            </div>
        </div>
        }else if(title=='科室'){
            return <div className='home_top'>
            <div className='home_left'>
                <ArrowLeft onClick={() => nav('/list')} />
            </div>
            <div className='home_center'>科室名称</div>
        </div>
        }else if(title=='详情'){
            return <div className='home_top'>
            <div className='home_left'>
                <ArrowLeft onClick={() => nav('/list')} />
            </div>
            
        </div>
        }else if(title=='预约信息'){
            return <div className='home_top'>
            <div className='home_left'>
                <ArrowLeft onClick={() => nav('/list')} />
            </div>
            <div className='home_center'>预约信息</div>
        </div>
        }
    }
    return (
        <div>
            {a()}
        </div>
    )
}
